/*
 *  ActionTools.cpp
 *  Cocos2DEditor
 *
 *  Created by waver on 10-6-21.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */
#import <Foundation/Foundation.h>
#import "ActionTools.h"

void JavaBitReverse(void* buffer, int size, int count)
{
	if( size == 2 )
	{
		for( int i=0; i<count; ++i )
		{
			REVERSE2BYTE( ((unsigned short*)buffer)[i] );
		}
	}
	else if( size == 4 )
	{
		for( int i=0; i<count; ++i )
		{
			REVERSE4BYTE( ((unsigned int*)buffer)[i] );       
		}
	}
}

const char* GetResPath(const char* file_name)
{
	NSString * path = [[NSString alloc] initWithUTF8String: file_name];
	
	if(![path isAbsolutePath])
		path = [[NSBundle mainBundle] pathForResource:path ofType:@""];
	
	return [path UTF8String];
}